Extensible Style Sheet Language (XSL) is an Extensible Markup Language (XML)-based language used for the transformation of XML documents using XSL Transformation (XSLT) style sheets. XSLT style sheets are designed to transform XML documents into new XML or “human-readable” documents. The new document may be in standard XML syntax or in another format, such as HTML, plain text, word processing documents, or spreadsheets. The XSLT processing model involves one or more XML source documents, one or more XSLT style sheets, an XSLT template processing engine (the processor), and one or more result documents. The XSLT processor ordinarily inputs two files—an XML source document and an XSLT style sheet—and outputs a result document. The XSLT style sheet contains the XSLT program text (or “source code” in other languages) and is itself an XML document that describes a collection of template rules: instructions and other hints that guide the processor toward the production of the result document by emitting elements of the desired output format. The following table provides a simple example of an input XML document, an XSLT style sheet, and a resulting output document.
Sample XML source document:<?xml version=“1.0” ?><persons><person username=“JS1”><name>John</name><family_name>Smith</family_name></person><person username=“MI1”><name>Morka</name><family_name>Ismincius</family_name></person></persons></xml>
Sample XSLT style sheet that provides templates to transform the XMLsource document:<?xml version=“1.0” ?><xsl:stylesheet xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”version=“1.0”><xsl:output method=“xml” indent=“yes”/><xsl:template match=“/”><root> <xsl:apply-templates/> </root></xsl:template><xsl:template match=“//person”><name username=“{@username}”><xsl:value-of select=“name” /></name></xsl:template></xsl:stylesheet></xml>
Sample XML result document:<?xml version=“1.0” encoding=“UTF-8”?> <root>  <name username=“JS1”>John</name>  <name username=“MI1”>Morka</name> </root></xml>
XSLT relies upon the XPath language for identifying subsets of the source document, as well as for performing calculations. The XPath language provides various methods of referring to elements or nodes of the XML source document, which are hierarchically organized as a tree. The XSLT language is declarative—rather than listing an imperative sequence of actions to perform in a stateful environment, template rules within the XSLT style sheet define how to handle a node matching a particular pattern specified using XPath. If the processor encounters a matching node in the source document, the processor applies the template rule. The processor typically builds a source tree from the XML source document and then starts by processing the source tree's root node, finding the best-matching template for that node in the XSLT style sheet, and evaluating the template's contents. Instructions of each template rule generally direct the processor to either create nodes in the result tree or process more nodes in the source tree in the same way as the root node. Output is derived from the result tree.
XSLT is a very powerful tool for converting data from one format to another. One field where data conversion can be used is Enterprise Resource Planning (ERP) systems. ERP refers to the integration of the data and processes of an organization into a unified system. ERP systems typically contain one or more modules for tasks such as order entry, accounting, human resources, marketing, and so forth. Most ERP systems use a unified database to store data for the various system modules. The introduction of an ERP system to replace two or more independent applications eliminates the need for external interfaces previously required between the applications, and provides additional benefits that range from standardization and lower maintenance (one system instead of two or more) to easier reporting and/or greater reporting capabilities (as all data is typically kept in one database). However, because of the custom nature of ERP systems, it is often useful to extract the data stored in the database for use in other common applications. For example, a user may want to create documents based on ERP data that can be viewed or edited using a familiar word processing application or spreadsheet program. The word processing program may provide superior capabilities for formatting and laying out text. Thus, by exporting the data from the ERP system to the other application, the user gains the benefits of both the unified ERP system and the capabilities of the other application.
XSLT is a good choice for extracting data from an ERP system into a format that is understandable by another application. Microsoft Dynamics NAV is one example of an ERP system that accepts an XSLT style sheet for this purpose. Before the user can extract data from the ERP system, the user typically creates an XSLT style sheet that describes how the data is to be converted. Unfortunately, the creation of an XSLT style sheet is a very cumbersome process that requires a skilled web/XML developer. Many smaller organizations may not have anyone with the skills to create an XSLT style sheet and may have to hire costly consultants. In addition, the tools available are very limited, such as standard text editors and basic hierarchical XML viewers. There are no graphical and user-friendly tools to create XSLT style sheets.